package com.xl.utils.configuration;

import com.xl.utils.interceptor.JwtInterceptor;
import com.xl.utils.interceptor.PagingParam;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @Author xionglin
 * @Classname WebMvcConfig
 * @Description 拦截器配置
 * @Date 2019/6/19 11:36
 */
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //拦截所以请求,除了登录
        //registry.addInterceptor(new JwtInterceptor()).addPathPatterns("/*A/**").excludePathPatterns("/**/login");
        //拦截所以请求，除了登录
       //registry.addInterceptor(new PagingParam()).addPathPatterns("/*/**").excludePathPatterns("/**/login");
        super.addInterceptors(registry);
    }
}